from django import forms


class BootStrapForm(forms.Form):
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        # 统一给ModelForm生成字段添加样式
        for name, field in self.fields.items():
            field.widget.attrs['class'] = 'form-control'
            placeholder = '请输入%s' % field.label
            field.widget.attrs['placeholder'] = placeholder
